package com.ndp.fb.rdb.api;

import java.util.List;
import java.util.Map;

import com.ndp.fb.rdb.model.AdGroup;
import com.ndp.fb.rdb.model.AdGroupExt;
import com.ndp.fb.rdb.model.VpiInfo;

/**
 * Created by Jacky on 2015/2/26.
 */
public interface AdRdbService{

    Long save(AdGroup obj);


    /**
     * 通过adGroupId找到adgroup
     * 6020297267861
     *
     * @param adGroupId
     * @return
     */
    AdGroup findByAdGroupId(Long adGroupId);


    /**
     * auth:Infi
     * findByAdSetId
     *
     * @param adSetId adSetId
     * @return List<AdGroup>
     */
    List<AdGroup> findByAdSetId(Long adSetId);


    /**
     * 获取广告的单价
     *
     * @param adGroupId
     * @param productConfId
     * @param fbConnectionObjectId
     * @param targeting1
     * @return
     * @discription
     * @author giser.yang
     * 创建时间 2015年5月7日 下午3:01:35
     */
     VpiInfo getPriceNew(Long adGroupId, Long productConfId, Long fbConnectionObjectId, String targeting1);



    List<AdGroup> findByFbAccountId(Long fbAccountId, int pIndex, int pSize);
    List<AdGroupExt> findAdGroupExtByFbAccountId(Long fbAccountId, int pIndex, int pSize);
    List<Long> findByFbAccountId(Long fbAccountId);
    List<Long> findByFbConnectObjectId(Long fbConnObjId);
    List<Long> findByFbAccountIdAndTime(Long fbAccountId, String beginTime, String endTime);
    List<Long> findByFbConnectObjectIdAndTime(Long fbConnObjId, String beginTime, String endTime);


    /**
     * 根据adGroupId从缓存中查询单价信息
     *
     * @param adGroupId 广告ID
     * @return 查询到的单价信息
     */
     VpiInfo findVpiFromCache(Long adGroupId);

    void updateAdGroupStatus(Long adGroupId, String adgroupStatus);

    void updateAdCreativeId(Long adGroupId, Long adCreativeId);

    void updateEcTemplateMaterielId(Long adGroupId,Long ecTemplateMaterielId);
}
